<?php
global $user;
if (empty($data))
    return;
$role = db_query("SELECT * FROM {users_roles WHERE users_roles.uid = %d", $user->uid);

while ($r = db_fetch_object($role)) {
    $role_id = $r->rid;
}
?>
<div id="spinner" class="spinner" style="visibility:hidden;">
    Searching...<img id="img-spinner" src="<?php echo base_path() ?>sites/all/themes/core101_fundraising/images/spinner.gif" alt="Loading"/>
</div>
<div class="contactsList">
    <form method="post" id="sendemail" action="<?php print url('campaign_notification', array('absolute' => true)); ?>">    
        <table id="contactListTable">
            <thead>
            <tr><th><input type="checkbox" class="checkall">Check/Clear all</th><th>Salutation</th><th>Name</th><th>E-mail</th><th></th></tr>
            </thead>
            <tbody>
            <?php foreach ($data as $value): ?>
                <tr id="<?php echo $value['nid']; ?>">
                    <td><input class="form-checkbox" type="checkbox" name="contacts[]" value="<?php echo $value['email'] . ',' . $value['salutation'] ?>"  /></td>
                    <td><?php echo $value['salutation']; ?></td>
                    <td><?php echo $value['name']; ?></td>
                    <td><?php echo $value['email']; ?></td>
                    <td><a href="<?php echo $base_url . 'edit/' . $value['nid'] ?>">Edit</a></td>
                    <td><a href="<?php echo $base_url . 'delete/' . $value['nid'] ?>">Delete</a></td>
                </tr>
            <?php endforeach; ?>
            </tbody>
        </table>
        <input class="sendemailsubmit" id="sendemailsubmit" type="submit" value="<?php echo 'Send Notification E-mail'; ?> " />
   </form>
</div>

